bool IsEmpty(Queue queue) {
    /* ÅÐ¶Ï¶ÓÁÐÊÇ·ñÎª¿Õ */
    if (queue->count == 0)
        return true;
    else
        return false;
}

void EnQueue(Queue queue, QElemSet x) {
    int rear;

    if (IsFull(queue)) {
        printf("ERROR\n");
    } else {
        rear = (queue->front + queue->count) % queue->capacity;
        queue->data[rear] = x;
        queue->count++;
    }
}

void DeQueue(Queue queue) {
    if (IsEmpty(queue)) {
        printf("ERROR\n");
    } else {
        queue->front = (queue->front + 1) % queue->capacity;
        queue->count--;
    }
}